const fs = require('fs')
let promise = new Promise((resolve, reject) => {
    fs.readFile('./text4.txt', 'utf8', (err, data) => {
        if (err) {
            reject(err)
        } else {
            resolve(data)
        }
    })
})
promise.then(res => {
    console.log(res);
}).catch(err => console.log(err))